home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_01
/
1101096b
< prev
next >
Wrap
Text File
|
1992-11-01
|
533b
|
30 lines
#include <iostream.h>
#include "fa4.h"
void display(const char *s, const float_array &fa)
{
cout << s << " = " << fa << endl;
}
int main()
{
size_t i, size;
cout << "size? ";
cin >> size;
float_array fa(size);
for (i = 0; i < fa.length(); ++i)
fa[i] = i;
display("fa", fa);
i = fa.length();
fa[i] = fa[i - 1] = 123;
display("fa", fa);
i = fa.length();
fa[i - 1] = fa[i] = 456;
display("fa", fa);
return 0;
}
----------